#!/bin/bash

# docker 批量push镜像
read -p "Please enter the repository address, port, and project where the image will be stored. For example: (192.168.235.22:8082/onap): " REGISTRY

image=`docker images | sed 1d | awk '{print $1":"$2}'`

for i in ${image[*]}; do

	echo "docker tag $i $REGISTRY/$image_name" 
	docker tag $image_name $REGISTRY/$image_name

	echo "docker push $REGISTRY/$image_name"	
	docker push $REGISTRY/$image_name

	docker image rm -f $REGISTRY/$image_name
	docker image rm -f $i

done
